package com.myproject.reflect;

public class Dog {

    public void sayHello(){
        System.out.println("hello");
    }

    public static void main(String[] args) throws IllegalAccessException, InstantiationException {

        Class c = Dog.class;
        Dog dog = (Dog) c.newInstance();
        dog.sayHello();

    }
}
